package main.java.indi.zyj.hot100;

import main.java.indi.zyj.hot100.base.TreeNode;

import java.util.ArrayList;
import java.util.List;

public class _30_inorderTraversal {

    List<Integer> res = new ArrayList<>();

    public List<Integer> inorderTraversal(TreeNode root) {

        inOrder(root);
        return res;

    }

    private void inOrder(TreeNode root) {
        if (root == null) {
            return;
        }
        inOrder(root.left);
        res.add(root.val);
        inOrder(root.right);
    }

}
